{extend name="./base" /}

{block name="body"}

<form class="layui-form model-form" id="thisForm">
	{:tpl_fourth_menu()}

	<div class="layui-form-item">
		<label class="layui-form-label">上传方式</label>
		<div class="layui-input-inline">
			<select name="form[type]">
				{foreach $type as $key=>$val}
				<option value="{$key}" {if !empty($data['type']) && $data['type'] ==  $key}selected{/if}>{$val}</option>
				{/foreach}
			</select>
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-input-block">
			<button class="layui-btn" lay-filter="formSubmit" lay-submit>保存</button>
			<button class="layui-btn layui-btn-primary" type="reset" >重置</button>
		</div>
	</div>
</form>
{/block}

{block name="script"}
<script>
	layui.use(['layer', 'form', 'table'], function () {
		var $ = layui.jquery, form= layui.form;

		// 表单提交
		form.on('submit(formSubmit)', function (data) {
			let formData = data.field;
			$.post('/admin/sms/config', formData, function(res){
				window.location.reload();
			})
			return false;
		});
	})
</script>
{/block}